﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Runtime.Remoting;
using System.Runtime.InteropServices;

namespace Dazzle {
    [Guid("3F39A30C-33B3-44ca-A463-AABF1B26F70D")]
    [ProgId("Gildata.Word.Graph.ChartPropertyControl")]
    [ClassInterface(ClassInterfaceType.None)]
    public partial class ChartPropertyControl : UserControl, IProvideObjectHandle, ISpecifyPropertyPages {
        public ChartPropertyControl() {
            InitializeComponent();
        }

        #region ISpecifyPropertyPage

        public void GetPages(out Win32.CAUUID pPages) {
            pPages = new Win32.CAUUID();

            pPages.cElems = 1;
            pPages.pElems = Marshal.AllocCoTaskMem(16);

            Guid g1 = typeof(ExamplePropertyPage).GUID;
            byte[] buffer = g1.ToByteArray();

            for (int i = 0; i < 16; i++) {
                Marshal.WriteByte(pPages.pElems, i, buffer[i]);
            }
        }

        #endregion


        #region IProvideObjectHandle Members

        public ObjectHandle ObjectHandle {
            get { return new ObjectHandle(this); }
        }

        #endregion

        
    }
}
